<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=@page_title || "专业测评系统"%></title>
<link href="/stylesheets/survey_public.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/javascripts/jquery/jquery-1.3.2.min.js"> </script>
<style>
#content{ width:885px; float:left;}
.contentt{ width:750px; float:left; background:url(/images/user/show_report/sdaf.jpg) no-repeat; }
.content01{ width:629px; height:78px; float:left; border-left:1px solid #b7b7b7; border-top:1px solid #b7b7b7; margin: 10px 0 0 58px; display:inline;}
.line01{ width:104px; height:25px; border-right:1px solid #b7b7b7; border-bottom:1px solid #b7b7b7; text-align:center; line-height:25px;}
.line02{ width:524px; height:25px; border-right:1px solid #b7b7b7; border-bottom:1px solid #b7b7b7; text-align:center; line-height:25px;}
.line03{ height:25px; border-right:1px solid #b7b7b7; border-bottom:1px solid #b7b7b7; text-align:center; line-height:25px;}




.content02{ width:715px; float:left; padding:36px 0 0 45px;}
.content02 table{margin-left:50px; border-left:1px solid #afa390;border-top:1px solid #afa390;text-align:center;}
.content02 tr{height="25px"}
.content02 td{border-right:1px solid #afa390;border-bottom:1px solid #afa390;width:85px}
#tj{ width:600px; height:44px; float:left;}
#tj li{ width:107px; height:44px; float:left;}
#tj li.jj{ width:435px; height:600px; float:left; border:1px solid #8d8d8d; text-align:center; line-height:30px; color:#000000; margin-top:12px;}

.content03{ width:715px; float:left; padding:20px 10px 0 40px;}

.back{ width:102px; height:35px; float:right; padding-right:20px; margin-top:20px;}
#footer{ width:100%; height:200px; float:left; background:url(/images/user/report/footer.jpg) no-repeat; text-align:center; color:#295c72;}
#footer h1{ margin-top:100px;}


#screenshot{
  width:250px;
	position:absolute;
	border:1px solid #ccc;
	background:#E0EBF3;
	padding:5px;
	display:none;
	color:#000000;
	}

/*  */
</style>
<script>
this.screenshotPreview = function(){	
	/* CONFIG */
		xOffset = -10;
		yOffset = 30;
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
	/* END CONFIG */
	$("a.screenshot").hover(function(e){
		id = this.title;
		var html = $.ajax({
      url: "/user/reports/original_question/"+id,
      async: false
     }).responseText; 
    $("body").append("<div id='screenshot'>"+html+"</div>");
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = id;	
		$("#screenshot").remove();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
$(document).ready(function(){
	screenshotPreview();
});
</script>
</head>
<body>
<div id="page">
	<div id="header">
		<ol>
      <li id="title-text"><%= @test.name %>详细记录</li>
		</ol>
		<ul>
        <li id="org-text"> <%=current_user.name%></li>
         <li> <a href="/login/logout">安全退出</a>
		</li>
		</ul>
</div>
	<div id="content">
    	        <div class="content01">
          <table width="629" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>
                <table width="629" border="0" cellspacing="0" cellpadding="0" height="25">
                  <tr>
                    <td align="center" class="line01">姓  名</td>
                    <td align="center" class="line01"><%=@test_record.username || "&nbsp;"%></td>
                    <td align="center" class="line01">性  别</td>
                    <td align="center" class="line01"><%=@test_record.gender || "&nbsp;"%></td>
                    <td align="center" class="line01">年  龄</td>
                    <td align="center" class="line01"><%=@test_record.age || "&nbsp;"%></td>
                  </tr>
                </table>

              </td>
            </tr>
            <tr>
              <td>
                <table width="629" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td class="line03">测评机构</td>
                    <td class="line02"><%=current_user.name || "&nbsp;"%></td>
                  </tr>
                </table>
              </td>
            </tr>
            <tr>
              <td>
                <table width="629" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td class="line03">量表名称</td>
                    <td class="line02"><%=@test.name || "&nbsp;"%></td>
                  </tr>
                </table>
              </td>
            </tr>
          </table>
        </div>
        <div class="content02">
        <% if @parts.size > 0 %>
      <table width="540" cellpadding="0" cellspacing="0" >
        <tr height="25px">
        <td><b>题号</b></td>
        <td><b>所选项</b></td>
        <td><b>题号</b></td>
        <td><b>所选项</b></td>
        <td><b>题号</b></td>
        <td><b>所选项</b></td>
        <td><b>题号</b></td>
        <td><b>所选项</b></td>
        </tr>
         <tr  height="25px" >
         <% i = 1 %>
        <% @original_results.each do |or_result |%>
          <% or_result.each do |o| %>
            <td><a href="#" rel="/user/reports/_question_choices" title="<%=o.question_id%>"class="screenshot" >第<%= i %>题</a></td>
            <td>
               <% if o.choice_num && o.choice_num >= 65  %>
                 <%= (o.choice_num).chr %>
               <% else %>
                 <%=o.value%>
               <% end %>
           </td><!--一道题目完成 下面题号加1 判断 是否要换行-->
            <% if i%4 == 0  %>
            </tr><tr height="25px">
            <% end %>
            <% i += 1 %>
        <% end %><!--part 循环-->
      <% end %>
      <% if i%4 == 1 %>
        <% elsif  i%4 == 2 %>
        <td>/</td><td>/</td>
        <td>/</td><td>/</td>
         </tr>
         <% elsif  i%4 == 2 %>
        <td>/</td><td>/</td>
       <td>/</td><td>/</td>
        <td>/</td><td>/</td>
         </tr>
         <% elsif  i%4 == 0 %>
        <td>/</td><td>/</td>
         </tr>
        <% end %>
      </table>
      </div>
      <% else %><!--是否 有part-->
      <table width="540" cellpadding="0" cellspacing="0">
        <tr height="25px">
        <td ><b>题号</b></td>
        <td><b>所选项</b></td>
        <td><b>题号</b></td>
        <td><b>所选项</b></td>
        <td><b>题号</b></td>
        <td><b>所选项</b></td>
        <td><b>题号</b></td>
        <td><b>所选项</b></td>
        </tr>
         <tr  height="25px" >
        <% i = 1 %>
          <% @original_results.each do |o| %>
            <td><a href="#" rel="/user/reports/_question_choices" title="<%=o.question_id%>"class="screenshot" >第<%= i %>题</a></td>
           <td>
           <% if o.choice_num && o.choice_num >= 65  %>
           <%= (o.choice_num).chr%>
           <% else %>
           <%=o.value%>
           <% end %>
           </td>
           <% i += 1 %>
            <% if i%4 == 1&& i <= @original_results.size %>
            </tr><tr height="25px">
            <% end %>
        <% end %>
      <% if i%4 == 1 %>
        <% elsif  i%4 == 3 %>
        <td>/</td><td>/</td>
        <td>/</td><td>/</td>
         </tr>
         <% elsif  i%4 == 2 %>
        <td>/</td><td>/</td>
        <td>/</td><td>/</td>
        <td>/</td><td>/</td>
         </tr>
         <% elsif  i%4 == 0 %>
        <td>/</td><td>/</td>
         </tr>
        <% end %>
      </table><br/>
      </div>
      <% end %>
        </div>
      <div class="back">
                <a href="/user/reports"><img src="/images/back.png" width="88" height="27" /></a>
        </div>
    </div>
    </div>
<div id="footer">
<h1>北京心嘉源咨询有限公司 CopyRight © www.iyaoi.cn 2009</h1>
</div>

</body>
</html>
